// app.js
import './utils/utils'
import './utils/http'
import './utils/qqmap'
App({
  // globalData: {},
  token:'',
  refreshToken:'',
  setToken(token, refreshToken){
    // 一般会做token持久化，本地存储
   wx.setStorageSync('token',token)
   this.token = token
   wx.setStorageSync('refreshToken',refreshToken)
   this.refreshToken = refreshToken
  },
  // 取token
  getToken(){
    const token = wx.getStorageSync('token')
    this.token = token
    const refreshToken = wx.getStorageSync('refreshToken')
    this.refreshToken = refreshToken
  },
  // 在页面一进入的时候，拿到token
  onLaunch(){
    this.getToken()
  }
})
